package javaBase.javaInnerClass;

/**
 * Created by Administrator on 2017/2/22 0022.
 */
public class OuterClass01 {
    private String name ;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    /**省略getter和setter方法**/
    public class InnerClass{
        public InnerClass(){
            name = "chenssy";
            age = 23;
        }
        public void display(){
            System.out.println("name：" + getName() +"   ;age：" + getAge());
        }
    }
    public static void main(String[] args) {
        OuterClass01 outerClass = new OuterClass01();
        OuterClass01.InnerClass innerClass = outerClass.new InnerClass();
        innerClass.display();
    }
}
